package com.usian.bussiness.service.impl;


import com.usian.bussiness.feign.AccountFeignService;
import com.usian.bussiness.feign.OrderFeignService;
import com.usian.bussiness.feign.StorageFeignService;
import com.usian.bussiness.service.BussinessService;
import org.springframework.beans.factory.annotation.Autowired;

public class BussinessServiceimpl implements BussinessService{
    @Autowired
    private AccountFeignService accountFeignService;
    @Autowired
    private OrderFeignService orderFeignService;
    @Autowired
    private StorageFeignService storageFeignService;

    @Override
    public void bussiness(String userId, String commodityCode, int count) {
        accountFeignService.debit(userId,count*1);
        storageFeignService.deduct(commodityCode,count);
        orderFeignService.create(userId,commodityCode,count);
    }
}
